home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
optivc16
/
vestd.h
< prev
next >
Wrap
C/C++ Source or Header
|
1999-03-06
|
20KB
|
473 lines
/* VEstd.h
vector management functions:
manipulations on whole arrays or vectors of data type "extended"
(real numbers: long double)
Copyright (c) 1996-1999 by Martin Sander
All Rights Reserved.
*/
#ifndef __VESTD_H
#define __VESTD_H
#if !defined( __VECLIB_H )
#include <VecLib.h>
#endif
#ifdef __BORLANDC__ /* 80-bit IEEE numbers supported:
the following 250 lines apply
only to Borland C++ */
#ifdef __cplusplus
extern "C" {
#endif
/************************* Generation **************************/
eVector __vf VE_vector( ui size );
eVector __vf VE_vector0( ui size );
/*************** Addressing single vector elements ******************/
extended _VFAR * VE_Pelement( eVector X, ui n );
/* returns a pointer to the n'th element of X. For the memory model
HUGE, the pointer is normalized. */
#define VE_element( X, n ) (*VE_Pelement( X, n ))
/******************* Initialization **********************************/
void __vf VE_equ0( eVector X, ui size );
void __vf VE_equ1( eVector X, ui size );
void __vf VE_equC( eVector X, ui size, extended C );
void __vf VE_equV( eVector Y, eVector X, ui size );
void __vf VEx_equV( eVector Y, eVector X, ui size,
extended A, extended B );
void __vf VE_ramp( eVector X, ui size,
extended Start, extended Rise );
void __vf VE_Parzen( eVector X, ui size );
void __vf VE_Welch( eVector X, ui size );
void __vf VE_Hanning( eVector X, ui size );
void __vf VE_comb( eVector X, ui size, unsigned step, extended C );
long __vf VE_random( eVector X, ui size, long seed,
extended MinVal, extended MaxVal );
long __vf VE_noise( eVector X, ui size, long seed, extended Amp );
/* VE_random and VE_noise return a new seed value.
random quality of VE_random is much better */
/*************** Data-type interconversions *************************/
/* for rounding functions, see VEmath.h ! */
void __vf V_SItoE( eVector Y, siVector X, ui size );
void __vf V_ItoE( eVector Y, iVector X, ui size );
void __vf V_LItoE( eVector Y, liVector X, ui size );
void __vf V_QItoE( eVector Y, qiVector X, ui size );
void __vf V_UStoE( eVector Y, usVector X, ui size );
void __vf V_UtoE( eVector Y, uVector X, ui size );
void __vf V_ULtoE( eVector Y, ulVector X, ui size );
void __vf V_FtoE( eVector Y, fVector X, ui size );
void __vf V_EtoF( fVector Y, eVector X, ui size );
void __vf V_DtoE( eVector Y, dVector X, ui size );
void __vf V_EtoD( dVector Y, eVector X, ui size );
/**************** Index-oriented manipulations ***********************/
void __vf VE_reflect( eVector X, ui size );
void __vf VE_rev( eVector Y, eVector X, ui size );
#if defined (V_HUGE)
void __vf VE_rotate( eVector Y, eVector X, ui size, long pos );
#else
void __vf VE_rotate( eVector Y, eVector X, ui size, int pos );
#endif
void __vf VE_delete( eVector X, ui size, ui pos );
void __vf VE_insert( eVector X, ui size, ui pos, extended C );
void __vf VE_sort( eVector Y, eVector X, ui size, int dir );
void __vf VE_sortind( uiVector Ind, eVector X, ui size, int dir );
void __vf VE_subvector( eVector Y, ui sizey, eVector X, int step );
void __vf VE_indpick( eVector Y, uiVector Ind, ui sizey, eVector X );
void __vf VE_indput( eVector Y, eVector X, uiVector Ind, ui sizex );
void __vf VE_indpick( eVector Y, uiVector Ind, ui size, eVector X );
ui __vf VE_searchC( eVector X, ui size, extended C, int mode );
void __vf VE_searchV( uiVector Ind, eVector X, ui sizex,
eVector Tab, ui sizetab, int mode );
void __vf VE_polyinterpol( eVector Y, eVector X, ui sizex,
eVector XTab, eVector YTab, ui sizetab, unsigned deg );
void __vf VE_ratinterpol( eVector Y, eVector X, ui sizex,
eVector XTab, eVector YTab, ui sizetab, unsigned deg );
void __vf VE_splinederiv2( eVector Y2, eVector XTab, eVector YTab,
ui size, int specify, extended Yp0, extended Ypn );
void __vf VE_splineinterpol( eVector Y, eVector X, ui sizex,
eVector XTab, eVector YTab, eVector Y2Tab, ui sizetab );
/***************** Functions of a sub-set of elements ********************/
void __vf VE_subvector_equC( eVector Y, ui subsiz, unsigned samp, extended C );
void __vf VE_subvector_equV( eVector Y, ui subsiz, unsigned samp, eVector X );
/* for arithmetic functions of subsets, see <VEmath.h> */
/**************** One-Dimensional Vector Operations ***********************/
extended __vf VE_max( eVector X, ui size );
extended __vf VE_min( eVector X, ui size );
extended __vf VE_absmax( eVector X, ui size );
extended __vf VE_absmin( eVector X, ui size );
int __vf VE_maxexp( eVector X, ui size );
int __vf VE_minexp( eVector X, ui size );
extended __vf VE_maxind( ui _VFAR *Ind, eVector X, ui size );
extended __vf VE_minind( ui _VFAR *Ind, eVector X, ui size );
extended __vf VE_absmaxind( ui _VFAR *Ind, eVector X, ui size );
extended __vf VE_absminind( ui _VFAR *Ind, eVector X, ui size );
ui __vf VE_localmaxima( uiVector Ind, eVector X, ui size );
ui __vf VE_localminima( uiVector Ind, eVector X, ui size );
void __vf VE_runmax( eVector Y, eVector X, ui size );
void __vf VE_runmin( eVector Y, eVector X, ui size );
extended __vf VE_sum( eVector X, ui size );
extended __vf VE_prod( eVector X, ui size );
void __vf VE_runsum( eVector Y, eVector X, ui size );
void __vf VE_runprod( eVector Y, eVector X, ui size );
int __vf VE_iselementC( eVector Tab, ui size, extended C );
ui __vf VE_iselementV( eVector Y, eVector X, ui sizex,
eVector Tab, ui sizetab );
/**************** Statistical Functions and Building Blocks *************/
extended __vf VE_sumabs( eVector X, ui size );
extended __vf VE_mean( eVector X, ui size );
extended __vf VE_meanwW( eVector X, eVector Wt, ui size );
extended __vf VE_meanabs( eVector X, ui size );
extended __vf VE_selected_mean( ui _VFAR *nsel, eVector X, ui size,
extended XMin, extended XMax ); /* takes only x with Min<=x<=Max */
extended __vf VE_median( eVector X, ui size );
extended __vf VE_sumdevC( eVector X, ui size, extended C );
extended __vf VE_sumdevV( eVector X, eVector Y, ui size );
extended __vf VE_avdevC( eVector X, ui size, extended C );
extended __vf VE_avdevV( eVector X, eVector Y, ui size );
extended __vf VE_ssq( eVector X, ui size );
extended __vf VE_rms( eVector X, ui size );
extended __vf VE_ssqdevC( eVector X, ui size, extended C );
extended __vf VE_ssqdevV( eVector X, eVector Y, ui size );
extended __vf VE_meanvar( extended _VFAR *Var, eVector X, ui size );
extended __vf VE_meanvarwW( extended _VFAR *Var, eVector X, eVector Wt, ui size );
extended __vf VE_varianceC( eVector X, ui size, extended C );
extended __vf VE_varianceV( eVector X, eVector Y, ui size );
extended __vf VE_varianceCwW( eVector X, eVector Wt, ui size, extended C );
extended __vf VE_varianceVwW( eVector X, eVector Y, eVector Wt, ui size );
extended __vf VE_chi2( eVector X, eVector Y, eVector InvVar, ui size );
extended __vf VE_chiabs( eVector X, eVector Y, eVector Wt, ui size );
extended __vf VE_corrcoeff( eVector X, eVector Y, ui size,
extended Xmean, extended Ymean );
ui __vf VE_distribution( uiVector Abund, eVector Limits, ui nbins,
eVector X, ui sizex, int mode );
void __vf VE_linregress( eVector Param, eVector X, eVector Y, ui size );
void __vf VE_linregresswW( eVector Param, eVector X, eVector Y,
eVector InvVar, ui size );
/* more (linear and nonlinear) d